package com.liang.serializable;

import java.io.*;

public class SerialiazbleDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Person p = new Person("zhangsan", 23);
        Person p1 = new Person("lisi", 24);


        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("day_13\\a.txt"));
        oos.writeObject(p);
        oos.writeObject(p1);
        oos.close();

        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("day_13\\a.txt"));
        Object o = ois.readObject();
        Object o1 = ois.readObject();
        System.out.println(o+"----"+o1);

    }
}
